<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="java.sql.*" %>
<%@ page contentType="text/html; charset=utf-8"%>
<jsp:useBean id="register" class="bean.registerbean"></jsp:useBean>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" contentType="text/html; charset=utf-8">
<title>注册插入</title>
</head>
<body>
<%
String name  =request.getParameter("name");
String password  =request.getParameter("password");
String user  =request.getParameter("user");
String email =request.getParameter("email"); 
        if(name==null||name.equals("")){
        response.sendRedirect("register.jsp");
        }else if(password==null||password.equals("")){
        response.sendRedirect("register.jsp");	
        }else if(user==null||user.equals("")){
        response.sendRedirect("register.jsp");
        }else if(email==null||email.equals("")){
        response.sendRedirect("register.jsp");	
        }    
     %>
<%
   
try{
	if(register.register(name ,password,user,email)){
		out.print("注册成功");
        out.println("<a href='login.jsp'>返回登录页面</a>");
    }else{
    	out.print("注册失败！"); 
        out.println("<a href='register.jsp'>重新注册</a>");
    }     
	   }catch(Exception ex){
	     ex.printStackTrace();
	    }
 %>
</body>
</html>